package cn.com.customer.manager.adapter

import android.widget.ImageView
import cn.com.customer.manager.R
import cn.com.customer.manager.bean.CustomerInfo
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder

class CallListAdapter(rid: Int): BaseQuickAdapter<CustomerInfo, BaseViewHolder>(rid) {
    override fun convert(helper: BaseViewHolder?, item: CustomerInfo?) {
        if (item != null) {
            helper?.let {
//                it.setText(R.id.tv_name,"")
//                it.setText(R.id.tv_call_time,"")
//                it.setText(R.id.tv_time,"")
                val iv_to_call_blue = helper?.getView(R.id.iv_to_call_blue) as ImageView
                val iv_email_sms = helper?.getView(R.id.iv_email_sms) as ImageView
                helper.addOnClickListener(R.id.iv_to_call_blue)
                iv_email_sms.setOnClickListener {
                    onItemChildClickListener?.onItemClick(helper.adapterPosition)
                }
            }
        }
    }
    private var onItemChildClickListener: OnItemChildClickListener? = null
    fun setOnItemChildClickListenerSms(onItemChildClickListener: OnItemChildClickListener?) {
        this.onItemChildClickListener = onItemChildClickListener
    }

    interface OnItemChildClickListener {
        fun onItemClick(position: Int)
    }
}